package com.jiedeng.mapper;

import com.jiedeng.mapper.provider.ReportSqlProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;
import java.util.Map;

/**
 * 报表
 */
@Mapper
public interface ReportMapper {
    /**
     * 明细表单位得分sql
     *
     * @param projectId
     * @return
     */
    @SelectProvider(type = ReportSqlProvider.class, method = "detailedReportSql3")
    List<Map<String, Object>> detailedReport(Long projectId);
    /**
     * 单位得分
     * @param corpPropId
     * @param projectId
     * @param corpId
     * @param startTime
     * @return
     */
    @SelectProvider(type = ReportSqlProvider.class, method = "getCorpScoringByProjectIdAndCorpIdAndTimeSql")
    List<Map<String, Object>>   getCorpScoringByProjectIdAndCorpIdAndTime(Long corpPropId,Long projectId,Long corpId,String startTime);
    /**
     * 明细表单位人员得分sql
     *
     * @param projectId
     * @return
     */
    @SelectProvider(type = ReportSqlProvider.class, method = "detailedCorpPersonReportSql3")
    List<Map<String, Object>> detailedCorpPersonReport(Long projectId, Long corpId);



    /**
     * 统计表获取检查信息sql
     *
     * @param projectId
     * @return
     */
    @SelectProvider(type = ReportSqlProvider.class, method = "statisticsReportInspectSql")
    List<Map<String, Object>> statisticsReportInspect(Long projectId, Long postId);

    /**
     * 检查表2 检查项
     *
     * @param taskId
     * @param specId
     * @return
     */
    @SelectProvider(type = ReportSqlProvider.class, method = "getCheckItemSql")
    List<Map<String, Object>> getCheckItem(String taskId, Integer specId);

    /**
     * 计分表2 查询rule count
     *
     * @param postId
     * @param corpId
     * @param checkIds
     * @return
     */
    @SelectProvider(type = ReportSqlProvider.class, method = "findCheckItemRuleCountSql")
    List<Map<String, Object>> findCheckItemRuleCount(Long postId, Long corpId, List<String> checkIds);
    @SelectProvider(type = ReportSqlProvider.class, method = "findCheckItemRuleCountSql2")
    List<Map<String, Object>> findCheckItemRuleCount2(Long postId, Long corpId, Integer propId, List<String> checkIds);
}
